import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '订单编号',
    align:"center",
    dataIndex: 'orderId_dictText'
   },
   {
    title: '步骤',
    align:"center",
    dataIndex: 'stepId_dictText'
   },
   {
    title: '计划开始时间',
    align:"center",
    dataIndex: 'planBeginDate'
   },
   {
    title: '计划结束时间',
    align:"center",
    dataIndex: 'planEndDate'
   },
   {
    title: '实际开始时间',
    align:"center",
    dataIndex: 'realBeginDate'
   },
   {
    title: '实际结束时间',
    align:"center",
    dataIndex: 'realEndDate'
   },
   {
    title: '当前步骤',
    align:"center",
    dataIndex: 'curStep'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "订单编号",
field: 'orderId',
component: 'Input',
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'orderId',
    field: 'orderId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
  },
  {
    label: '计划结束时间',
    field: 'planEndDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '实际开始时间',
    field: 'realBeginDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '实际结束时间',
    field: 'realEndDate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '当前步骤',
    field: 'curStep',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  orderId: {title: 'orderId',order: 0,view: 'number', type: 'number',dictCode: '',},
  setpId: {title: 'setpId',order: 1,view: 'list', type: 'string',dictCode: '',},
  planBeginDate: {title: '计划开始时间',order: 2,view: 'datetime', type: 'string',},
  planEndDate: {title: '计划结束时间',order: 3,view: 'datetime', type: 'string',},
  realBeginDate: {title: '实际开始时间',order: 4,view: 'datetime', type: 'string',},
  realEndDate: {title: '实际结束时间',order: 5,view: 'datetime', type: 'string',},
  curStep: {title: '当前步骤',order: 6,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
